package com.software.demo10;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class C304 {
    private String location;
    //在没有指定name、type情况下，默认先去找名字， 再找类型
    //如果指定了就按指定的去找
    //@Resource(type = Student.class)

    //第二种注解,通过类型找
    @Autowired
    private Student student;

    public void show() {
        System.out.println(this.student.getStuId());
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }
}
